{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 自动控制理论\n",
    "--- "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 控制系统的时域分析"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 时域分析的着手点  \n",
    "- 稳定性：  \n",
    "- 瞬态性能：  \n",
    "- 稳态性能：  \n",
    "\n",
    "### 单输入单输出线性定常系统的微分方程  \n",
    "因为一般的系统都具有惯性，所以一般微分方程的形式为：  \n",
    "$$\\sum\\limits_{i=0}^{n}a_i\\frac{d^ic(t)}{dt^i} = \\sum\\limits_{j=0}^{m}b_j\\frac{d^jc(t)}{dt^j}, n \\geqslant m \\tag{1}$$  \n",
    "对两边拉普拉斯变换，由于高阶微分的拉氏变换会用到系统的初始状态（常数值），所以最后系统在复域内会变成如下形式：  \n",
    "$$C(s) = \\frac{\\sum\\limits_{j=0}^{m}b_js^j}{\\sum\\limits_{i=0}^{n}a_is^i}R(s) + \\frac{N_{c0}(s)}{\\sum\\limits_{i=0}^{n}a_is^i}$$  \n",
    "可以看到：  \n",
    "- 系统有一部分只与输入有关，叫做零状态响应；\n",
    "- 另一部分与输入无关，叫做零输入响应。  \n",
    "\n",
    "而课本中一般研究经典（零状态，各阶导数都为0）条件下的系统响应。\n",
    "\n",
    "### 典型输入信号  \n",
    "典型输入信号的是作用在$t\\in(0,+\\infty)$的\n",
    "1. 单位脉冲：狄拉克脉冲函数，积分后得到  \n",
    "2. 单位阶跃：$f(t)=1$赫维赛德函数，积分后得到  \n",
    "3. 单位斜坡函数：$f(t)=t$，积分后得到  \n",
    "4. 单位加速度函数：$f(t)=\\frac{1}{2}t^2$  \n",
    "5. 正弦信号：$f(t)=A\\sin{(\\omega t + \\phi)}$  \n",
    "\n",
    "### 性能指标  \n",
    "一般系统稳定在终值$\\pm5\\%/\\pm2\\%$误差带内即视为达到最终状态。    \n",
    "\n",
    "#### 瞬态性能指标  \n",
    "1. 延迟时间：单位阶跃响应第一次达到终值的$50\\%$所用的时间$t_{delay}$  \n",
    "2. 上升时间：单位阶跃响应从终值的$10\\% \\rightarrow 90\\%$所用的时间$t_{raise}$  \n",
    "3. 峰值时间：单位阶跃响应第一次达到峰值的时间$t_{peak}$  \n",
    "4. 超调量：$\\sigma\\%$，峰值超过终值的百分比  \n",
    "5. 调节时间：系统稳定在终值误差带内的时间$t_{stable}$  \n",
    "\n",
    "#### 稳态性能指标  \n",
    "1. 稳态误差：最终稳定的实际输出与理想输出的误差  \n",
    "\n",
    "系统对一种信号稳定，对另一种信号未必稳定。  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 一阶系统的时域分析   \n",
    "一阶系统一般可以看作微分环节$\\frac{1}{Ts}$加单位负反馈组成，其闭环传递函数为：  \n",
    "$$G(s)=K\\frac{1}{Ts+1}, \\, T为时间常数$$    \n",
    "\n",
    "所有的性能指标都是根据传递函数标准形式对应的时间常数$T$确定的！！！  \n",
    "\n",
    "输入函数|单位脉冲|单位阶跃|单位斜坡|单位加速度  \n",
    ":---:|:---:|:---:|:---:|:---:  \n",
    "$t_d$|-|$0.69T$|-|-  \n",
    "$t_r$|-|$2.20T$|-|-  \n",
    "$t_p$|-|-|-|-  \n",
    "$t_s$|$3T$|$4T$|$3T$|-  \n",
    "$\\sigma\\%$|-|%0%|-|-  \n",
    "$e_ss$|0|0|$T$|$\\infty$  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 二阶系统的时域分析  \n",
    "二阶系统的开环传递函数相当于一阶系统前面加了一个积分环节，所以一般开环传递函数可以写作：  \n",
    "$$G(s)=\\frac{K}{s(Ts+1)} = \\frac{\\omega_n^2}{s(s+2\\xi\\omega_n)}$$  \n",
    "其中：  \n",
    "1. $\\xi$称为二阶系统的阻尼比；  \n",
    "2. $\\omega_n$称为系统的无阻尼振荡频率或自然振荡频率；  \n",
    "3. $K=\\frac{\\omega}{2\\xi}$称为开环增益；  \n",
    "4. $T=\\frac{1}{2\\xi\\omega}$称为时间常数。   \n",
    "\n",
    "再加上单位负反馈，闭环函数可写作：  \n",
    "$$G(s) = \\frac{\\omega^2}{s^2+2\\xi\\omega_ns+\\omega_n^2} \\tag{2}$$  \n",
    "函数有两个极点：$s_{1,2}=-\\xi\\omega_n\\pm j\\sqrt{1-\\xi^2}\\omega_n$，一般写作：$\\sigma\\pm j\\omega_d$。另外，极点与负实轴的夹角为：$\\beta=\\arccos{\\xi}$。x\n",
    "\n",
    "#### 单位阶跃响应  \n",
    "单位阶跃响应在复域中表示为：$C(s)=\\frac{\\omega^2}{s(s^2+2\\xi\\omega_ns+\\omega_n^2)}$。在$\\xi\\leqslant0$时，系统有正实部的极点，因此是不稳定的。原因见高阶系统稳定性的判定。所以一般只讨论三种情况：  \n",
    "\n",
    "性能指标|欠阻尼|临界阻尼|过阻尼  \n",
    ":---:|:---:|:---:|:---:  \n",
    "判定条件|$0<\\xi<1$|$\\xi=1$|$1<\\xi$\n",
    "$t_r$|$\\frac{\\pi-\\beta}{\\omega_d}$|所有指标与过阻尼一起讨论|$\\frac{1}{\\omega_n}(1+1.5\\xi+\\xi^2)$\n",
    "$t_p$|$\\frac{\\pi}{\\omega_d}$|-|$t_d=\\frac{1}{\\omega_n}(1+0.6\\xi+0.2\\xi^2)$\n",
    "$\\sigma\\%$|$e^{-\\frac{\\xi\\pi}{\\sqrt{1-\\xi^2}}}\\times 100\\%$|-|-\n",
    "$t_s$|$\\frac{3.5}{\\xi\\omega_n},\\,_{\\pm0.05}或\\frac{4.5}{\\xi\\omega_n},\\,_{\\pm0.02}$|-|$\\frac{1}{\\omega_n}(6.45\\xi-1.7),\\,_{\\xi\\leqslant0.7}$\n",
    "$e_{ss}$|$0$|-|$0$  \n",
    "\n",
    "1. 系统阻尼比越大，超调量越小  \n",
    "2. 极点与原点的连线称为等阻尼线，等阻尼线上阻尼比相同，超调量也相同  \n",
    "3. 当阻尼比一定时，$\\omega_n$越大，系统振幅越大，稳定性越差  \n",
    "\n",
    "#### 单位脉冲响应  \n",
    "略\n",
    "\n",
    "#### 单位斜坡响应  \n",
    "主要判断稳态误差与稳定时间  \n",
    "\n",
    "性能指标|欠阻尼|临界阻尼|过阻尼  \n",
    ":---:|:---:|:---:|:---:  \n",
    "判定条件|$0<\\xi<1$|$\\xi=1$|$1<\\xi$\n",
    "$t_p$|$\\frac{\\pi-\\beta}{\\omega_d}$|-|-\n",
    "$t_s$|$\\frac{3}{\\xi\\omega_n},\\,_{\\pm0.05}$|$\\frac{4.1}{\\omega_n}$|-\n",
    "$e_{ss}$|$\\frac{2\\xi}{\\omega_n}$|$\\frac{2}{\\omega_n}$|$\\frac{2\\xi}{\\omega_n}$\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 高阶系统的时域分析  \n",
    "高阶系统的传递函数一般可写为：  \n",
    "$$\\Phi(s)=K^*\\frac{\\prod\\limits_{j=1}^{m}(s-z_j)}{\\prod\\limits_{i=1}^{n}(s-p_i)} \\tag{3}$$  \n",
    "\n",
    "对于（单位阶跃）响应的话，一般有：  \n",
    "$$C(s)=\\Phi(s)R(s)=\\sum\\limits_{i=1}^{n_{\\Phi}+n_r}\\frac{A_i}{s-p_i}$$  \n",
    "然后拉氏反变换后会得到一堆指数函数：  \n",
    "$$h(t)=\\sum\\limits_{i=1}^{n_{\\Phi}+n_r}A_ie^{p_it} \\tag{4}$$  \n",
    "只有当所有的极点都落在左半轴或者某些极点的值为$0$，才能保证系统是稳定的。  \n",
    "- 正实部不稳定  \n",
    "- 零实部临界稳定  \n",
    "- 负实部稳定  \n",
    "\n",
    "#### 主导闭环极点  \n",
    "- 极点越靠近虚轴，证明衰减的越慢  \n",
    "- 靠近虚轴且附近没有零点，那么就称为主导极点  \n",
    "\n",
    "#### 闭环偶极子  \n",
    "如果一对闭环零极点的距离比它们的模小一个数量级，那么就可以称为闭环偶极子。可以被忽略掉。  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.1"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD6CAYAAACvZ4z8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Z1A+gAAAACXBIWXMAAAsTAAALEwEAmpwYAAAg0UlEQVR4nO3de3hc9X3n8fdX97t8kWyML/gKwVxDhCE0XFJysdMtbrPQmLBPTEofmgvPpmmzXefJs5TSNlmym5BNQ9q6hQ2BNEBISP0sJs6FJqThZpkARhhjYQyWcWxJtnXXaEb67h9z5AzjkXUkzYysOZ/X8+jRmXN+R+enM6PP/PQ7Z34/c3dERKRwFU13BUREJLcU9CIiBU5BLyJS4BT0IiIFTkEvIlLgFPQiIgUuVNCb2Voz221mrWa2KcP2K8zsOTNLmNm1GbbXmVmbmX0jG5UWEZHwSsYrYGbFwF3A+4E2YLuZbXH3l1OKvQncCHxujB/zN8ATYSrU0NDgS5cuDVNUREQCO3bs6HD3xkzbxg16YA3Q6u57AczsAWA9cDzo3X1fsG0kfWczexcwH/gR0DTewZYuXUpzc3OIaomIyCgze2OsbWG6bhYC+1MetwXrwhy4CPgKY7f0RUQkx3J9MfZTwFZ3bztZITO72cyazay5vb09x1USEYmWMF03B4DFKY8XBevCeDdwuZl9CqgBysys193fdkHX3TcDmwGampo0+I6ISBaFCfrtwCozW0Yy4DcAHw3zw939htFlM7sRaEoPeRERya1xu27cPQHcAmwDdgEPuXuLmd1uZtcAmNnFZtYGXAf8k5m15LLSIiISnp1qwxQ3NTW57roREZkYM9vh7hnvbNQnY0VECpyCPtDVH+e7z77JYHx4uqsiIpJVCvrAlx7bxed/sJPr/vEpjvYNTXd1RESyRkEPvNnZz/d2tPHu5XPZeaCLB7bvH38nEZEZQkEPfOvJfRQXGV/bc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+nZ373b33mB5K1BqZnmZzdzdDwTfDwOPkPwXOlWoidxzZB3wnLsfSt8wnecMODTafRV8P5yhzLScNzO7EfhPwA1BQJwgxHOeVe5+yN2H3X0E+Ocxjjdd56sE+DDw4Fhlcn2+xsiHvLzGZmLQT2Wy8pwJ+v/uBna5+1fHKHPa6LUCM1tD8vzn4w2o2sxqR5dJXsx7Ka3YFuBjlnQp0JXyL2WujdnSmq5zFkh9HW0E/i1DmW3AB8xsdtBV8YFgXc6Y2VrgL4Fr3L1/jDJhnvNs1yv1ms4fjnG8MH+/ufA+4BV3b8u0Mdfn6yT5kJ/XWC6uMOf6i+QdIq+SvHr/hWDd7SRf+AAVJLsBWoFngeV5qNN7SP7b9SLwfPD1IeATwCeCMrcALSTvNHgauCxP52t5cMwXguOPnrPUuhlwV3BOdwJNeapbNcngrk9Zl/dzRvKN5iAQJ9kHehPJ6zo/A/YAPwXmBGWbgH9J2fePg9daK/DxPNSrlWSf7ejrbPQOs9OBrSd7znNcr/uC186LJANsQXq9gscn/P3msl7B+m+NvqZSyubzfI2VD3l5jemTsSIiBW4mdt2IiMgEKOhFRAqcgl5EpMAp6EVECpyCXkSkwCnoRUQKnIJeRKTAKehFRArc/wf+2/dX+NYtSwAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from control import *  \n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline\n",
    "G1=tf([1],[1, 2, 10])\n",
    "T,yout = step_response(G1,20)\n",
    "# impulse_response(G1,20)\n",
    "\n",
    "fig, ax = plt.subplots()  # Create a figure containing a single axes.\n",
    "ax.plot(T, yout);  # Plot some data on the axes.\n",
    "# damp(G1)  # 求控制系统参数\n",
    "dcgain(G1) # 计算静态误差系数\n",
    "# rlocus(G1, plotstr=[])\n"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "63fd5069d213b44bf678585dea6b12cceca9941eaf7f819626cde1f2670de90d"
  },
  "kernelspec": {
   "display_name": "Python 3.9.7 64-bit",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
